package com.houger.ddd.seckill.constant;

import java.util.Arrays;

public enum RewardIssueTypeEnum {

    NOT_ISSUE(0,"不发放奖励"),
    AUTO_ISSUE(1,"自动发放"),
    MANUAL(2,"手动领取"),
    ;


    private int value;
    private String desc;

    RewardIssueTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static RewardIssueTypeEnum getEnumByCode(int value) {
        return Arrays.stream(RewardIssueTypeEnum.values()).filter(a -> a.value == value).findFirst().orElse(NOT_ISSUE);
    }
}
